// pages/testype/testype.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.query(options)
      .then(this.codeData.bind(this));
  },

  query(o) {
    //开始发送请求
    return new Promise(resolve => {
      wx.request({
        url: 'http://47.107.121.61/user/ques',
        method: "GET",
        header: {
          'content-type': 'application/json'
        },
        success: res => {
          const status = res.data.status;
          const data = res.data.data;
          resolve(data);
        }
      })
    })
  },

  codeData(data) {
    let quesData = [];
    quesData = data;
    this.setData({ quesData })
  }
})